package Excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.metadata.CellData;

import java.util.Map;

public class excelListener extends AnalysisEventListener<entity> {

    /**
     * 一行一行读取excel中的数据
     */
    @Override
    public void invoke(entity data, AnalysisContext context) {
        System.out.println("-----" + data);
    }

    /**
     * 读取表头内容
     */
    @Override
    public void invokeHead(Map<Integer, CellData> headMap, AnalysisContext context) {
        System.out.println("-----" + headMap);
    }

    /**
     * 读取完成之后进行的操作
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }
}